package com.kang.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "reply",autoResultMap = true)
public class Reply implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /**
     * 文章id
     */
    private Integer essayId;

    /**
     * 回复信息
     */
    private String text;

    /**
     * 用户id
     */
    private Integer userId;

    /**
     * 上一条回复id
     */
    private Integer lastId;


    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 用户名
     */
    private String username;

    private String userUrl;

    private String lastName;


    /**
     * 下级评论
     */
    @TableField(exist = false)
    private List<Reply> children;

    @TableField(exist = false)
    private String lastUrl;


}
